#ifndef READ_BOY_BOOK_H__
#define READ_BOY_BOOK_H__
#include "read_boy.h"
#include "string.h"

#include "ff.h"
#define BOOK_PATH_FOLDER  "/dzs"
#define BOOK_PATH_NEWFILE_TXT "/dzs/list.txt"
#define BOOK_PATH_NEWFILE     "list.txt"




typedef  struct read_boy_book_t{
    uint32_t lseek;
    uint32_t totle;//文件大小
    uint16_t width;
    uint16_t hight;
    uint16_t iX;
    uint16_t iY;
    uint16_t iX_initial_value;
    uint16_t iY_initial_value;
    
    uint16_t line;//行
    uint16_t char_num;//一页字符总数
    
    uint8_t *book;
    
    uint8_t en_font_x;
    uint8_t en_font_y;
    
    uint8_t cn_font_x;
    uint8_t cn_font_y;
    uint8_t line_hight;
    
    read_boy_font_t EN_font;
    read_boy_font_t CN_font;
    //====================
    uint8_t sd_book_total_count;
    uint8_t sd_current_book_num;
    //uint32_t sd_lseek;
    int8_t book_name[30];
    int8_t book_end_flag;
    //============================
    uint16_t old_index;
    uint16_t new_index;
    
    

}read_boy_book_t;

extern read_boy_book_t my_read_boy_book;

void my_read_boy_book_init();
void read_boy_book_task();
void read_boy_book_set_en_font(read_boy_font_t  font);
void read_boy_book_set_cn_font(read_boy_font_t  font);

void read_boy_book_init_set_Table_of_Contents();
void read_boy_book_show_Table_of_Contents();
void read_boy_book_total_num_init();

char readboy_key_scan();
void readboy_key_init();
void readboy_book_full_disp_or_part();
//void read_boy_book_show_Contents(char key_num);
char read_boy_book_show_Contents();
char read_boy_book_set();
char read_boy_book_show_book();

#define READ_BOY_BOOK_DISP              readboy_book_full_disp_or_part()
#define READ_BOY_BOOK_FULL_PART(num)    my_drv_base.drv_fullpart(num)
#define READ_BOY_BOOK_SET_DEPTH(num)    my_drv_base.drv_setDepth(num)
#define READ_BOY_BOOK_DISP_CLEAR        read_boy_fb_clear()


#endif